var app = getApp();
Page({
  data: {
    orderNumber: "",
    contractData: "",
    dateArr:""
  },
  onLoad(options) {

  },
  onReady() {

  },
  onShow() {
      this.init()
  },

  init () {
      let orderNumber = wx.getStorageSync('orderNumber');
      this.setData({
          orderNumber: orderNumber
      }, function () {

          this.getLoadFn()
      })
  },
  getLoadFn: function () {
    
    let _this = this;
    let orderNumber = this.data.orderNumber;
    console.log('getLoadFn',orderNumber)
    wx.request({
      url: app.globalData.url, 
      method: "get",
      data: {
          api: "app.orderV2.getOrderAgreementInfo",
          storeId: 1,
          storeType: 6,
          orderParentId: orderNumber
      },



      header: {
        'content-type': 'application/json' 
      },
      success (res) {
        
        if (res.data && res.data.code == 200) {
              let resData = res.data.data;
              let dateArr = resData.createDate.split("-");
              _this.setData({
                contractData: resData,
                dateArr: dateArr
              })
            } else {

          }
      }
    })
  }
})